#ifndef __TRIANGLE_H__
#define __TRIANGLE_H__


#include "Shape.h"
#include "Stage.h"


class Triangle : public Shape {

	private:
		Point* posicion1; // Son los tres vertices.
		Point* posicion2;
		Point* posicion3;

        SDLDrawManager manager;
        SDLDrawElement e[3];
		int r,g,b;


	
	public:
		Triangle(); // Constructor.
		virtual ~Triangle(); // Destructor.

		// GET y SET para cada atributo.

	    void setPosicion1(Point* point);
		Point* getPosicion1();

		void setPosicion2(Point* point);
		Point* getPosicion2();
	    
		void setPosicion3(Point* point);
		Point* getPosicion3();

		void draw(SDL_Surface *screen);

		void drawTexture(SDL_Surface *auxSurface, int thickness);
		
    	void initManagerElement(int x, int y);

	    void setManagerElement(SDL_Surface * auxSurface, SDLDrawElement * eAux);

		int getMin(int a, int b, int c);
		
		int getMax(int a, int b, int c);
		
		void getDims(int * w, int * h, int * x, int * y);

		int serialize(Element* elem);

		void hydrate(Element* elem);

		void fillColor(SDL_Surface *screen, SDLDrawElement * eAux);

		float norma (int x1, int y1, int x2, int y2);

		void fillThickness(SDL_Surface *screen, int thickness);

		void initThicknessX(SDLDrawElement * e, Point * p1, Point * p2,int gr,int iThickness);
		
		void initThicknessY(SDLDrawElement * e, Point * p1, Point * p2,int gr,int iThickness);
	
		void putThickness(SDL_Surface * screen, SDLDrawElement * e);

		void collide(Shape* shape, Point* puntoChoque);

		void update();

		
};


#endif __TRIANGLE_H__